/**
 * author: XGP
 * date: 2018/07/19
 * des: 员工花名册
 */
import request from '@/utils/request'

/**
 * 1查询员工状态统计
 */
export function getEmployeesNumber() {
  return request({
    url: '/hr/employeemanage/employees/count4Status',
    method: 'get'
  })
}

/**
 * 2查询list
 */
export function getEmployeesOnJob(params) {
  return request({
    url: '/hr/employeemanage/employees/page',
    method: 'get',
    params: params
  })
}

/**
 * 3 人事异动
 */
export function turnoverApi(params, status) {
  return request({
    url: '/employeeturnoverinfos/insert?employeeStatus=' + status,
    method: 'post',
    data: params
  })
}

/**
 * 4 试用期-办理离职
 */
export function quitApi(params) {
  return request({
    url: '/hr/employeemanage/leave/applyIng',
    method: 'put',
    params: params
  })
}

/**
 * 5 办理入职
 */
export function dealOnJobApi(params) {
  return request({
    url: '/hr/employeemanage/employees/' + params.intvId + '/entry',
    method: 'post',
    data: params
  })
}

/**
 * 6 放弃入职
 */
export function abandonJobApi(params) {
  return request({
    url: '/hr/employeemanage/employees/' + params.intvId + '/giveupEntry',
    method: 'put',
    params: params
  })
}

/**
 * 7 试用延期
 */
export function probationDelayApi(params) {
  return request({
    url: '/hr/employeemanage/employees/' + params.employeeNo + '/probationDelay',
    method: 'put',
    params: params
  })
}

/**
 * 8 放弃离职
 */
export function giveupLeaveApi(params) {
  return request({
    url: '/hr/employeemanage/employees/' + params.employeeNo + '/giveupLeave',
    method: 'put',
    params: params
  })
}

/**
 * 9 待离职-确认离职
 */
export function confirmLeaveApi(params) {
  return request({
    url: '/hr/employeemanage/leave/confirmLeave',
    method: 'put',
    params: params
  })
}

/**
 * 10 待入职-调整入职信息
 */
export function adjustWaitJobApi(params) {
  return request({
    url: '/hr/employeemanage/employees/updateIng',
    method: 'put',
    data: params
  })
}

/**
 * 11 试用期-办理转正
 *
 **/
export function conrrectApi(params) {
  return request({
    url: '/hr/employeemanage/employees/' + params.employeeNo + '/conrrect',
    method: 'put',
    params: params
  })
}

/**
 * 12 待离职-调整离职信息
 *
 **/
export function adjustQuitApi(params) {
  return request({
    url: '/hr/employeemanage/leave/updateLeaveInfo',
    method: 'put',
    params: params
  })
}

/**
 * 13 离职-撤销离职信息
 *
 **/
export function revokeLeaveApi(params) {
  return request({
    url: '/hr/employeemanage/employees/' + params.employeeNo + '/revokeLeave',
    method: 'put',
    params: params
  })
}


/**
 * 14 查询员工信息
 */
export function getEmployeeInfoApi(id) {
  return request({
    url: '/hr/employeemanage/employees/find?employeeNo=' + id,
    method: 'get'
  })
}


/**
 * 15 在职-办理离职
 */
export function onJobQuitApi(params) {
  return request({
    url: '/hr/employeemanage/leave/apply',
    method: 'put',
    params: params
  })
}

/**
 * 16 离职-重新入职
 */
export function reOnJobQuitApi(params) {
  return request({
    url: '/hr/employeemanage/employees/' + params.employeeNo + '/reEntry',
    method: 'put',
    params: params
  })
}

/**
 * 17 获取面试记录
 */
export function getIntInfoApi(id) {
  return request({
    url: '/employeeinterviewerprocesss/findByEmployeeNo/' + id,
    method: 'get'
  })
}

/**
 * 18 获取奖惩记录
 */
export function rewardsApi(id) {
  return request({
    url: '/employeerewardpunishments/findByEmployeeNo/' + id +'?paramName=001',
    method: 'get'
  })
}
/**
 * 19 添加奖惩记录
 */
export function addRewardsApi(params) {
  return request({
    url: '/employeerewardpunishments/insert',
    method: 'post',
    data: params
  })
}

/**
 * 20 修改奖惩记录
 */
export function editRewardsApi(params) {
  return request({
    url: '/employeerewardpunishments/update/' + params.id,
    method: 'put',
    params: params
  })
}

/**
 * 20 删除奖惩记录
 */
export function deleteRewardsApi(params) {
  const p = {
    employeeNo: params.employeeNo
  }
  return request({
    url: '/employeerewardpunishments/delete/' + params.id,
    method: 'delete',
    params: p
  })
}

/**
 * 21 修改员工信息
 */
export function editJobInfoApi(params) {
  return request({
    url: '/hr/employeemanage/employees/' + params.employeeNo + '/updateBaseInfo',
    method: 'put',
    params: params
  })
}

/**
 * 22 获取教育经历
 */
export function getEducationApi(employeeNo) {
  return request({
    url: '/employeeguaduations/findByEmployeeNo/' + employeeNo,
    method: 'get'
  })
}


/**
 * 23 添加教育经历
 */
export function addEducationApi(params) {
  return request({
    url: '/employeeguaduations/insert',
    method: 'post',
    params: params
  })
}

/**
 * 24 修改教育经历
 */
export function editEducationApi(params) {
  return request({
    url: '/employeeguaduations/update/' + params.id,
    method: 'put',
    params: params
  })
}


/**
 * 25 删除教育经历
 */
export function deleteEducationApi(params) {
  const obj = {
    employeeNo: params.employeeNo
  }
  return request({
    url: '/employeeguaduations/delete/' + params.id,
    method: 'delete',
    params: obj
  })
}

/**
 * 26 获取工作经历
 */
export function getExperiencesApi(employeeNo) {
  return request({
    url: '/employeeworkexperiences/findByEmployeeNo/' + employeeNo,
    method: 'get'
  })
}


/**
 * 27 添加工作经历
 */
export function addExperiencesApi(params) {
  return request({
    url: '/employeeworkexperiences/insert',
    method: 'post',
    params: params
  })
}

/**
 * 28 修改工作经历
 */
export function editExperiencesApi(params) {
  return request({
    url: '/employeeworkexperiences/update/' + params.id,
    method: 'put',
    params: params
  })
}


/**
 * 29 删除工作经历
 */
export function deleteExperiencesApi(params) {
  const obj = {
    employeeNo: params.employeeNo
  }
  return request({
    url: '/employeeworkexperiences/delete/' + params.id,
    method: 'delete',
    params: obj
  })
}

/**
 * 30 获取培训经历
 */
export function getTrainCareerApi(employeeNo) {
  return request({
    url: '/employeetrains/findByEmployeeNo/' + employeeNo,
    method: 'get'
  })
}


/**
 * 31 添加培训经历
 */
export function addTrainCareerApi(params) {
  return request({
    url: '/employeetrains/insert',
    method: 'post',
    params: params
  })
}

/**
 * 32 修改培训经历
 */
export function editTrainCareerApi(params) {
  return request({
    url: '/employeetrains/update/' + params.id,
    method: 'put',
    params: params
  })
}


/**
 * 33 删除培训经历
 */
export function deleteTrainCareerApi(params) {
  const obj = {
    employeeNo: params.employeeNo
  }
  return request({
    url: '/employeetrains/delete/' + params.id,
    method: 'delete',
    params: obj
  })
}

/**
 * 34 获取证书证件
 */
export function getCertificateApi(employeeNo) {
  return request({
    url: '/employeecertinfos/findByEmployeeNo/' + employeeNo,
    method: 'get'
  })
}


/**
 * 35 添加证书证件
 */
export function addCertificateApi(params) {
  return request({
    url: '/employeecertinfos/insert',
    method: 'post',
    params: params
  })
}

/**
 * 36 修改证书证件
 */
export function editCertificateApi(params) {
  return request({
    url: '/employeecertinfos/update/' + params.id,
    method: 'put',
    params: params
  })
}


/**
 * 37 删除证书证件
 */
export function deleteCertificateApi(params) {
  const obj = {
    employeeNo: params.employeeNo
  }
  return request({
    url: '/employeecertinfos/delete/' + params.id,
    method: 'delete',
    params: obj
  })
}


/**
 * 38 获取家庭成员
 */
export function getContactApi(employeeNo) {
  return request({
    url: '/employeefamilys/findByEmployeeNo/' + employeeNo,
    method: 'get'
  })
}

/**
 * 39 添加家庭成员
 */
export function addContactApi(params) {
  return request({
    url: '/employeefamilys/insert',
    method: 'post',
    params: params
  })
}

/**
 * 40 修改家庭成员
 */
export function editContactApi(params) {
  return request({
    url: '/employeefamilys/update/' + params.id,
    method: 'put',
    params: params
  })
}


/**
 * 41 删除家庭成员
 */
export function deleteContactApi(params) {
  const obj = {
    employeeNo: params.employeeNo
  }
  return request({
    url: '/employeefamilys/delete/' + params.id,
    method: 'delete',
    params: obj
  })
}

/**
 * 42 获取社保公众信息
 */
export function getSalaryInofApi(employeeNo) {
  return request({
    url: '/employeesalarys/find/' + employeeNo,
    method: 'get'
  })
}

/**
 * 43 查询工资记录
 */
export function getSalaryApi(employeeNo) {
  return request({
    url: '/employeesalarys/findSalaryFlow/' + employeeNo,
    method: 'get'
  })
}

/**
 * 44 查询合同信息
 */
export function getConttactApi(employeeNo) {
  return request({
    url: '/hr/employeemanage/employeeconstract/find4Employee?employeeNo=' + employeeNo,
    method: 'get'
  })
}

/**
 * 45 修改工资卡信息
 */
export function saveSalaryCardApi(params) {
  return request({
    url: '/employeesalarys/updatePayCard',
    method: 'put',
    params: params
  })
}


/**
 * 46 修改社保卡信息
 */
export function saveSocialSecurityApi(params) {
  return request({
    url: '/employeesalarys/updateSocialSecurity',
    method: 'put',
    params: params
  })
}

/**
 * 47 修改公积金卡信息
 */
export function saveFundCardApi(params) {
  return request({
    url: '/employeesalarys/updateProvidentFund',
    method: 'put',
    params: params
  })
}

/**
 * 48 添加合同信息
 */
export function addConttactApi(params) {
  return request({
    url: '/hr/employeemanage/employeeconstract/add',
    method: 'post',
    params: params
  })
}

/**
 * 49 修改合同信息
 */
export function editConttactApi(params) {
  return request({
    url: '/hr/employeemanage/employeeconstract/' + params.id + '/update',
    method: 'put',
    params: params
  })
}

/**
 * 50 删除合同信息
 */
export function deleteConttactApi(params) {
  const obj = {
    employeeNo: params.employeeNo
  }
  return request({
    url: '/hr/employeemanage/employeeconstract/' + params.id + '/delete',
    method: 'delete',
    params: obj
  })
}

/**
 * 51 查询员工操作记录
 */
export function getEditLogApi(employeeNo) {
  return request({
    url: '/hr/employeemanage/employees/findModifyHis/' + employeeNo,
    method: 'get'
  })
}

/**
 * 52 添加员工
 */
export function addRosterApi(params) {
  return request({
    url: '/hr/employeemanage/employees/addEmployee',
    method: 'post',
    data: params
  })
}

/**
 * 53 修改紧急联系人信息
 */
export function saveDmergencyApi(params) {
  return request({
    url: '/hr/employeemanage/employees/' + params.employeeNo + '/updateEmergencyContactInfo',
    method: 'put',
    params: params
  })
}

/**
 * 54 查询异动记录
 */
export function queryChangelogsApi(employeeNo) {
  return request({
    url: '/employeeturnoverinfos/selectTurnoverList/' + employeeNo,
    method: 'get'
  })
}

/**
 * 55 修改在职信息
 * /v1/hr/employeemanage/employees/{employeeNo}/updateWorkInfo
 */
export function otherEditJobInfoApi(params) {
  return request({
    url: '/hr/employeemanage/employees/' + params.employeeNo + '/updateWorkInfo',
    method: 'put',
    params: params
  })
}

/**
 * 56 修改基础信息
 * /v1/hr/employeemanage/employees/{employeeNo}/updateBaseInfo
 */
export function otherBaseInfoApi(params) {
  return request({
    url: '/hr/employeemanage/employees/' + params.employeeNo + '/updateBaseInfo',
    method: 'put',
    params: params
  })
}

/**
 * 57 修改联系人
 */
export function editContractinfoApi(params) {
  return request({
    url: '/hr/employeemanage/employees/' + params.employeeNo + '/updateContactInfo',
    method: 'put',
    params: params
  })
}

/**
 * 58 获取离职信息
 */
export function getLeaveInfoApi(params) {
  return request({
    url: '/hr/employeemanage/leave/queryInfo',
    method: 'get',
    params: params
  })
}

/**
 * 59 根据部门查岗位（定岗定薪表）
 */
export function getPositionApi(params) {
  return request({
    url: '/hr/recruitment/recruitplan/findPositionByOrg',
    method: 'get',
    params: params
  })
}

/**
 * 60 根据员工部门，岗位查询职级
 */
export function getRankApi(params) {
  return request({
    url: '/hr/salary/salaryfixs/findLevel',
    method: 'get',
    params: params
  })
}

/**
 * 61 查询材料附件分类
 */
export function getAttachmentApi(params) {
  return request({
    url: '/hremployeeattachments/findAll',
    method: 'get',
    params: params
  })
}

/**
 * 62 新增材料附件分类
 */
export function addAttachmentApi(data) {
  return request({
    url: '/hremployeeattachments/insert',
    method: 'post',
    data: data
  })
}

/**
 * 62 上传材料附件分类
 */
export function uploadAttachmentApi(data) {
  data.busiFunc = 'hr_employee_attachment'
  return request({
    url: '/hremployeeattachments/uploadAdd',
    method: 'post',
    data: data
  })
}

/**
 * 63 修改附件分类
 */
export function updateAttachmentApi(data) {
  return request({
    url: '/hremployeeattachments/update',
    method: 'put',
    data: data
  })
}

/**
 * 64 查询附件历史
 */
export function getAttachmentDocApi(data) {
  data.busiFunc = 'hr_employee_attachment'
  return request({
    url: '/docmanager/queryDocs',
    method: 'get',
    params: data
  })
}

/**
 * 65 删除材料附件
 */
export function deleteAttachmentDocApi(params) {
  return request({
    url: '/hremployeeattachments/delete',
    method: 'delete',
    params: params
  })
}

/**
 * 66 查询所有员工数据
 */
export function getAllEmpApi(params) {
  return request({
    url: '/hr/employeemanage/employees/findAll',
    method: 'get',
    params: params
  })
}


/**
 * 入职列表
 */
export function getDealDelayList(params) {
  params.status = '1'
  return request({
    url: '/salaryapplys/findAllRz',
    method: 'get',
    params: params
  })
}

